\(\int x \cosh (a+b x-c x^2) \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 14, antiderivative size = 112 \[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=-\frac {b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {b e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {\sinh \left (a+b x-c x^2\right )}{2 c} \]

[Out]

-1/2*sinh(-c*x^2+b*x+a)/c-1/8*b*exp(a+1/4*b^2/c)*erf(1/2*(-2*c*x+b)/c^(1/2))*Pi^(1/2)/c^(3/2)-1/8*b*exp(-a-1/4
*b^2/c)*erfi(1/2*(-2*c*x+b)/c^(1/2))*Pi^(1/2)/c^(3/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {5491, 5483, 2266, 2236, 2235} \[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=-\frac {\sqrt {\pi } b e^{a+\frac {b^2}{4 c}} \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {\sqrt {\pi } b e^{-a-\frac {b^2}{4 c}} \text {erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {\sinh \left (a+b x-c x^2\right )}{2 c} \]

[In]

Int[x*Cosh[a + b*x - c*x^2],x]

[Out]

-1/8*(b*E^(a + b^2/(4*c))*Sqrt[Pi]*Erf[(b - 2*c*x)/(2*Sqrt[c])])/c^(3/2) - (b*E^(-a - b^2/(4*c))*Sqrt[Pi]*Erfi
[(b - 2*c*x)/(2*Sqrt[c])])/(8*c^(3/2)) - Sinh[a + b*x - c*x^2]/(2*c)

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 5483

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] + Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rule 5491

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[e*(Sinh[a + b*x + c*x^2]/(
2*c)), x] - Dist[(b*e - 2*c*d)/(2*c), Int[Cosh[a + b*x + c*x^2], x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b*
e - 2*c*d, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\sinh \left (a+b x-c x^2\right )}{2 c}+\frac {b \int \cosh \left (a+b x-c x^2\right ) \, dx}{2 c} \\ & = -\frac {\sinh \left (a+b x-c x^2\right )}{2 c}+\frac {b \int e^{a+b x-c x^2} \, dx}{4 c}+\frac {b \int e^{-a-b x+c x^2} \, dx}{4 c} \\ & = -\frac {\sinh \left (a+b x-c x^2\right )}{2 c}+\frac {\left (b e^{-a-\frac {b^2}{4 c}}\right ) \int e^{\frac {(-b+2 c x)^2}{4 c}} \, dx}{4 c}+\frac {\left (b e^{a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{4 c} \\ & = -\frac {b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {b e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {\sinh \left (a+b x-c x^2\right )}{2 c} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.20 \[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=\frac {b \sqrt {\pi } \text {erfi}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right ) \left (\cosh \left (a+\frac {b^2}{4 c}\right )-\sinh \left (a+\frac {b^2}{4 c}\right )\right )+b \sqrt {\pi } \text {erf}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right ) \left (\cosh \left (a+\frac {b^2}{4 c}\right )+\sinh \left (a+\frac {b^2}{4 c}\right )\right )-4 \sqrt {c} \sinh (a+x (b-c x))}{8 c^{3/2}} \]

[In]

Integrate[x*Cosh[a + b*x - c*x^2],x]

[Out]

(b*Sqrt[Pi]*Erfi[(-b + 2*c*x)/(2*Sqrt[c])]*(Cosh[a + b^2/(4*c)] - Sinh[a + b^2/(4*c)]) + b*Sqrt[Pi]*Erf[(-b +
2*c*x)/(2*Sqrt[c])]*(Cosh[a + b^2/(4*c)] + Sinh[a + b^2/(4*c)]) - 4*Sqrt[c]*Sinh[a + x*(b - c*x)])/(8*c^(3/2))

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.07

method result size
risch \(\frac {{\mathrm e}^{c \,x^{2}-b x -a}}{4 c}+\frac {b \sqrt {\pi }\, {\mathrm e}^{-\frac {4 a c +b^{2}}{4 c}} \operatorname {erf}\left (\sqrt {-c}\, x +\frac {b}{2 \sqrt {-c}}\right )}{8 c \sqrt {-c}}-\frac {{\mathrm e}^{-c \,x^{2}+b x +a}}{4 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{\frac {4 a c +b^{2}}{4 c}} \operatorname {erf}\left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{8 c^{\frac {3}{2}}}\) \(120\)

[In]

int(x*cosh(-c*x^2+b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/4/c*exp(c*x^2-b*x-a)+1/8*b/c*Pi^(1/2)*exp(-1/4*(4*a*c+b^2)/c)/(-c)^(1/2)*erf((-c)^(1/2)*x+1/2*b/(-c)^(1/2))-
1/4/c*exp(-c*x^2+b*x+a)-1/8*b/c^(3/2)*Pi^(1/2)*exp(1/4*(4*a*c+b^2)/c)*erf(-c^(1/2)*x+1/2*b/c^(1/2))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 384 vs. \(2 (88) = 176\).

Time = 0.26 (sec) , antiderivative size = 384, normalized size of antiderivative = 3.43 \[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=\frac {2 \, c \cosh \left (c x^{2} - b x - a\right )^{2} - \sqrt {\pi } {\left (b \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) - b \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left (b \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) - b \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt {-c} \operatorname {erf}\left (\frac {{\left (2 \, c x - b\right )} \sqrt {-c}}{2 \, c}\right ) + \sqrt {\pi } {\left (b \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + b \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left (b \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + b \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt {c} \operatorname {erf}\left (\frac {2 \, c x - b}{2 \, \sqrt {c}}\right ) + 4 \, c \cosh \left (c x^{2} - b x - a\right ) \sinh \left (c x^{2} - b x - a\right ) + 2 \, c \sinh \left (c x^{2} - b x - a\right )^{2} - 2 \, c}{8 \, {\left (c^{2} \cosh \left (c x^{2} - b x - a\right ) + c^{2} \sinh \left (c x^{2} - b x - a\right )\right )}} \]

[In]

integrate(x*cosh(-c*x^2+b*x+a),x, algorithm="fricas")

[Out]

1/8*(2*c*cosh(c*x^2 - b*x - a)^2 - sqrt(pi)*(b*cosh(c*x^2 - b*x - a)*cosh(1/4*(b^2 + 4*a*c)/c) - b*cosh(c*x^2
- b*x - a)*sinh(1/4*(b^2 + 4*a*c)/c) + (b*cosh(1/4*(b^2 + 4*a*c)/c) - b*sinh(1/4*(b^2 + 4*a*c)/c))*sinh(c*x^2
- b*x - a))*sqrt(-c)*erf(1/2*(2*c*x - b)*sqrt(-c)/c) + sqrt(pi)*(b*cosh(c*x^2 - b*x - a)*cosh(1/4*(b^2 + 4*a*c
)/c) + b*cosh(c*x^2 - b*x - a)*sinh(1/4*(b^2 + 4*a*c)/c) + (b*cosh(1/4*(b^2 + 4*a*c)/c) + b*sinh(1/4*(b^2 + 4*
a*c)/c))*sinh(c*x^2 - b*x - a))*sqrt(c)*erf(1/2*(2*c*x - b)/sqrt(c)) + 4*c*cosh(c*x^2 - b*x - a)*sinh(c*x^2 -
b*x - a) + 2*c*sinh(c*x^2 - b*x - a)^2 - 2*c)/(c^2*cosh(c*x^2 - b*x - a) + c^2*sinh(c*x^2 - b*x - a))

Sympy [F]

\[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=\int x \cosh {\left (a + b x - c x^{2} \right )}\, dx \]

[In]

integrate(x*cosh(-c*x**2+b*x+a),x)

[Out]

Integral(x*cosh(a + b*x - c*x**2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 674 vs. \(2 (88) = 176\).

Time = 0.39 (sec) , antiderivative size = 674, normalized size of antiderivative = 6.02 \[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=\frac {1}{2} \, x^{2} \cosh \left (c x^{2} - b x - a\right ) + \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{2} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac {5}{2}}} - \frac {4 \, b c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {5}{2}}} - \frac {4 \, {\left (2 \, c x - b\right )}^{3} \Gamma \left (\frac {3}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} \left (-c\right )^{\frac {5}{2}}}\right )} b e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{32 \, \sqrt {-c}} + \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{3} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac {7}{2}}} - \frac {6 \, b^{2} c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {7}{2}}} - \frac {12 \, {\left (2 \, c x - b\right )}^{3} b \Gamma \left (\frac {3}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} \left (-c\right )^{\frac {7}{2}}} - \frac {8 \, c^{2} \Gamma \left (2, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-c\right )^{\frac {7}{2}}}\right )} c e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{32 \, \sqrt {-c}} + \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{2} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}} c^{\frac {5}{2}}} + \frac {4 \, b e^{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{c^{\frac {3}{2}}} - \frac {4 \, {\left (2 \, c x - b\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} c^{\frac {5}{2}}}\right )} b e^{\left (-a - \frac {b^{2}}{4 \, c}\right )}}{32 \, \sqrt {c}} - \frac {1}{32} \, {\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{3} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}} c^{\frac {7}{2}}} + \frac {6 \, b^{2} e^{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{c^{\frac {5}{2}}} - \frac {12 \, {\left (2 \, c x - b\right )}^{3} b \Gamma \left (\frac {3}{2}, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} c^{\frac {7}{2}}} - \frac {8 \, \Gamma \left (2, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{c^{\frac {3}{2}}}\right )} \sqrt {c} e^{\left (-a - \frac {b^{2}}{4 \, c}\right )} \]

[In]

integrate(x*cosh(-c*x^2+b*x+a),x, algorithm="maxima")

[Out]

1/2*x^2*cosh(c*x^2 - b*x - a) + 1/32*(sqrt(pi)*(2*c*x - b)*b^2*(erf(1/2*sqrt((2*c*x - b)^2/c)) - 1)/(sqrt((2*c
*x - b)^2/c)*(-c)^(5/2)) - 4*b*c*e^(-1/4*(2*c*x - b)^2/c)/(-c)^(5/2) - 4*(2*c*x - b)^3*gamma(3/2, 1/4*(2*c*x -
 b)^2/c)/(((2*c*x - b)^2/c)^(3/2)*(-c)^(5/2)))*b*e^(a + 1/4*b^2/c)/sqrt(-c) + 1/32*(sqrt(pi)*(2*c*x - b)*b^3*(
erf(1/2*sqrt((2*c*x - b)^2/c)) - 1)/(sqrt((2*c*x - b)^2/c)*(-c)^(7/2)) - 6*b^2*c*e^(-1/4*(2*c*x - b)^2/c)/(-c)
^(7/2) - 12*(2*c*x - b)^3*b*gamma(3/2, 1/4*(2*c*x - b)^2/c)/(((2*c*x - b)^2/c)^(3/2)*(-c)^(7/2)) - 8*c^2*gamma
(2, 1/4*(2*c*x - b)^2/c)/(-c)^(7/2))*c*e^(a + 1/4*b^2/c)/sqrt(-c) + 1/32*(sqrt(pi)*(2*c*x - b)*b^2*(erf(1/2*sq
rt(-(2*c*x - b)^2/c)) - 1)/(sqrt(-(2*c*x - b)^2/c)*c^(5/2)) + 4*b*e^(1/4*(2*c*x - b)^2/c)/c^(3/2) - 4*(2*c*x -
 b)^3*gamma(3/2, -1/4*(2*c*x - b)^2/c)/((-(2*c*x - b)^2/c)^(3/2)*c^(5/2)))*b*e^(-a - 1/4*b^2/c)/sqrt(c) - 1/32
*(sqrt(pi)*(2*c*x - b)*b^3*(erf(1/2*sqrt(-(2*c*x - b)^2/c)) - 1)/(sqrt(-(2*c*x - b)^2/c)*c^(7/2)) + 6*b^2*e^(1
/4*(2*c*x - b)^2/c)/c^(5/2) - 12*(2*c*x - b)^3*b*gamma(3/2, -1/4*(2*c*x - b)^2/c)/((-(2*c*x - b)^2/c)^(3/2)*c^
(7/2)) - 8*gamma(2, -1/4*(2*c*x - b)^2/c)/c^(3/2))*sqrt(c)*e^(-a - 1/4*b^2/c)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.10 \[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=-\frac {\frac {\sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )}\right ) e^{\left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt {c}} + 2 \, e^{\left (-c x^{2} + b x + a\right )}}{8 \, c} - \frac {\frac {\sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {-c} {\left (2 \, x - \frac {b}{c}\right )}\right ) e^{\left (-\frac {b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt {-c}} - 2 \, e^{\left (c x^{2} - b x - a\right )}}{8 \, c} \]

[In]

integrate(x*cosh(-c*x^2+b*x+a),x, algorithm="giac")

[Out]

-1/8*(sqrt(pi)*b*erf(-1/2*sqrt(c)*(2*x - b/c))*e^(1/4*(b^2 + 4*a*c)/c)/sqrt(c) + 2*e^(-c*x^2 + b*x + a))/c - 1
/8*(sqrt(pi)*b*erf(-1/2*sqrt(-c)*(2*x - b/c))*e^(-1/4*(b^2 + 4*a*c)/c)/sqrt(-c) - 2*e^(c*x^2 - b*x - a))/c

Mupad [F(-1)]

Timed out. \[ \int x \cosh \left (a+b x-c x^2\right ) \, dx=\int x\,\mathrm {cosh}\left (-c\,x^2+b\,x+a\right ) \,d x \]

[In]

int(x*cosh(a + b*x - c*x^2),x)

[Out]

int(x*cosh(a + b*x - c*x^2), x)